package org.xserver.component.listener;


//@Component
public class XServerAgent {
	//
	//	private static final Logger log = LoggerFactory
	//			.getLogger(XServerAgent.class);
	//	@Resource
	//	private XServerHttpConfig xServerHttpConfig;
	//
	//	private MBeanServer xserverMBeanServer;
	//
	//	public void initXServerAgent(Executor executor) {
	//		if (executor instanceof XServerMemoryAwareThreadPoolExecutor) {
	//			xserverMBeanServer = ManagementFactory.getPlatformMBeanServer();
	////			 MBeanServerFactory
	////			 .createMBeanServer("xserver");
	//
	//			HtmlAdaptorServer htmlAdaptorServer = new HtmlAdaptorServer();
	//
	//			XServerMemoryAwareThreadPoolExecutorStatus threadPoolStatus = new XServerMemoryAwareThreadPoolExecutorStatus(
	//					(XServerMemoryAwareThreadPoolExecutor) executor);
	//
	//			try {
	//				xserverMBeanServer
	//						.registerMBean(htmlAdaptorServer, new ObjectName(
	//								"xserver:adaptor=htmlAdaptor,port=9020"));
	//				xserverMBeanServer
	//						.registerMBean(
	//								threadPoolStatus,
	//								new ObjectName(
	//										"xserver:threadPool=xserverMemoryAwareThreadPool"));
	//				htmlAdaptorServer.setPort(xServerHttpConfig.getAgentPort());
	//				htmlAdaptorServer.start();
	//			} catch (Exception e) {
	//				log.error("register MBean error.", e);
	//			}
	//		}
	//	}
}
